{extend name="public:base" /}
{block name="style"}
<link rel="stylesheet" type="text/css" href="__INDEX__/css/public.css">
<link rel="stylesheet" type="text/css" href="__INDEX__/css/style.css">
<link rel="stylesheet" type="text/css" href="__INDEX__/css/responsive.css">
<link rel="shortcut icon" href="__INDEX__/images/favorite.ico">
{/block}
{block name="html"}
{include file="index@public/main" /}
<div class="right_style">
	<h3 class="title_style"><em></em><span>我的订单</span></h3>
	<div id="order">
		<div class="Order_form_filter">
			<a href="{:url('Upgoods/index',array('status'=>'all'))}" class="{$status=='all'?'active':''}">全部订单</a>
			<a href="{:url('Upgoods/index',array('status'=>'que'))}" class="{$status=='que'?'active':''}">待确认</a>
			<a href="{:url('Upgoods/index',array('status'=>'fahuo'))}" class="{$status=='fahuo'?'active':''}">待发货</a>
			<a href="{:url('Upgoods/index',array('status'=>'shouhuo'))}" class="{$status=='shouhuo'?'active':''}">待收货</a>
			<a href="{:url('Upgoods/index',array('status'=>'wanchang'))}" class="{$status=='wanchang'?'active':''}">已完成</a>
		</div>
		<div class="Tab">
			<!--全部交易-->
			{if condition="$data"}
			<div class="Order_form_list on">
				<div class="Order_form_list_top">
					<p class="list0">商品</p>
					<p class="list1">单价</p>
					<p class="list2">数量</p>
					<p class="list3">合计</p>
					<p class="list4">操作</p>
				</div>
				<ul class="ul">
					{volist name='data' id='vo'}
					<li>
						<div class="order-index-top" name="{$vo.id}">
							<p class="l" >订单号：<span>{$vo.order_sn}</span></p>
							<p class="r" >时间：<span>{$vo.add_time|date="Y-m-d H:m",###}</span></p>
						</div>
						<div class="order-proBg_all">
							<div class="order-proBg">
								<div class="order-index">
									<div class="list0" >
										<a href="javascript:;">
											<img src="{$vo.goods_image}" />
											<div class="l">
												<p class="name">{$vo.goods_name}</p>
											</div>
										</a>
									</div>
									<div class="list1 price">
										<p>￥{$vo.goods_price}</p>
									</div>
									<p class="list2">X <span>{$vo.num}</span></p>
								</div>
							</div>
							<p class="list3 status">￥{$vo.amount}</p>
							<div class="list4 opeation">

								{if condition="$vo.z_time eq 0"}
								<a href="javascript:;" class="opea to_pay" name="{$vo.order_sn}">提货</a>
								{elseif condition="$vo.f_time eq 0" /}
								<a href="javascript:;" class="opea">待发货</a>
                                {elseif condition="$vo.q_time eq 0" /}
                                <a href="javascript:;" class="opea">待收货</a>
                                {else /}
                                <a href="javascript:;" class="opea">已完成</a>
								{/if}
								<a class="opea del">删除订单</a>
							</div>
						</div>
					</li>
					{/volist}
				</ul>
			</div>
			{else /}
			<!--没有记录时显示-->
            <div class="no_record" style="width: 200px;text-align: center;margin: 0 auto;margin-top: 100px;">
                <img src="__INDEX__/images/kong.png" style="width: 100px;"/>
                <p style="text-align: center;color: #555;font-size: 14px;">暂无订单</p>
            </div>
            {/if}
		</div>
	</div>
</div>

{/block}

{block name="javascript"}
<script type="text/javascript" src="__INDEX__/js/jquery.flexslider-min.js"></script>
<script src="__INDEX__/js/jquery-1.9.1.min.js"></script>
<script src="__INDEX__/js/public.js"></script>
<script src="__INDEX__/layer/layer.js"></script>
<script>

    var w = $(document).width();
    if(w >= 500) {
        w = 600;
    } else if(w <= 480) {
        w = 375;
    }

    $('ul .to_pay').on("click",function(){
        var order_sn = $(this).attr('name');
        layer.open({
            type: 2,
            title: '支付密码',
            maxmin: true,
            shadeClose: true, //点击遮罩关闭层
            area: [w * 0.9 + "px", '150px'],
            content: ['/index/Depot/pay/sn/'+order_sn],
        });
    })  
</script>
<script>
    $('ul .order-index-top').on("click",function(){
        var order_id = $(this).attr('name');
        window.location.href = '/index/upgoods/detail/id/'+order_id;
    });
</script>
{/block}